package turretbehavior 
{
	/**
	 * ...
	 * @author morgan
	 */
	public class SpeedModulationBehavior extends TurretBehavior
	{
		public var period:Number;
		public var amplitude:Number;
		public function SpeedModulationBehavior(period:Number, amplitude:Number) 
		{
			this.period = period;
			this.amplitude = amplitude;
		}
		
		override public function onUpdate(t:Turret):void 
		{
			super.onUpdate(t);
			
			t.fireSpeed += Math.cos(t.behaviorTime * Math.PI * 2 / period) * amplitude;
		}
		
	}

}